package com.scau.ums.util.dao;

import org.apache.poi.util.StringUtil;

public class InfoSql {
    public String  getUncheckedInfoList(String receiverId){
        String  sql = "SELECT * FROM `ums`.`Info` where receiver_id='"+ receiverId +"' and state = 'unchecked'";
        return sql;
    }

    public String getAllInfoList(String receiverId){
        String sql = "SELECT * FROM `ums`.`Info` where receiver_id='"+ receiverId +"'";
        return sql;
    }

    public String getSpecifiedInfo(Integer infoId){
        String sql = "SELECT * FROM `ums`.`Info` where id="+ infoId;
        return sql;
    }


    public String InfoIsChecked(Integer InfoId){
        String sql = "UPDATE `ums`.`Info` SET state = 'checked' where id = "+InfoId;
        return sql;
    }

    public String countUncheckedInfo(String receiverId){
        String sql= "select count(*) from Info where state='unchecked' and receiver_id="+receiverId;
        return sql;
    }
}
